package mya_dc.shared_classes;

import java.io.Serializable;

/**
 * A container for username, password and project name.
 * 
 * @author      Adam Levi
 * <br>			MYA
 */
public class MYA_Authentication implements Serializable
{
 	private static final long serialVersionUID = 1L;
 	
	/**
	 * Constructor
	 *
	 * @param 	userName - The user name.
	 * @param	password - The password
	 * @param	project  - The project name.
	 */
	public MYA_Authentication(
			String userName,
			String password,
			String project)
	{
		m_UserName 	= userName;
		m_Project 	= project;
		m_Password	= password; 
	}
	@Override
	public int hashCode() {
		return m_UserName.hashCode() + m_Project.hashCode();
	}
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof MYA_Authentication) {
			MYA_Authentication tmp = (MYA_Authentication) obj;
			return (tmp.m_UserName.equals(m_UserName) && tmp.m_Project.equals(m_Project));
		}
		return false;
	}
	public String getUserName()
	{
		return m_UserName;
	}
	public String getProject()
	{
		return m_Project;
	}
	public String getPassword()
	{
		return m_Password;
	}
	private String m_UserName;
	private String m_Project;
	private String m_Password;
}